/*
 *@Student 张策
 */
import java.util.Scanner;

public class Text {
    private static final String CORRECT_USERNAME = "admin";
    private static final String CORRECT_PASSWORD = "123456";
    private static final int MAX_ATTEMPTS = 3;
    private static final long WAIT_TIME = 30 * 1000; // 30 seconds in milliseconds

    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//        int attempts = 0;
//        boolean loggedIn = false;
//
//        while (attempts < MAX_ATTEMPTS && !loggedIn) {
//            System.out.print("请输入用户名： ");
//            String username = scanner.nextLine();
//            System.out.print("请输入密码： ");
//            String password = scanner.nextLine();
//
//            if (CORRECT_USERNAME.equals(username) && CORRECT_PASSWORD.equals(password)) {
//                loggedIn = true;
//                System.out.println("登录成功！");
//            } else {
//                attempts++;
//                if (attempts < MAX_ATTEMPTS) {
//                    System.out.println("用户名或密码错误，请重新输入。");
//                    try {
//                        Thread.sleep(100);
//                    } catch (InterruptedException e) {
//                        e.printStackTrace();
//                    }
//                } else {
//                    System.out.println("已达到最大尝试次数，登录失败。");
//                }
//            }
//        }
//
//        scanner.close();
        fun();
    }
    public static void fun(){
        Scanner scanner=new Scanner(System.in);
        int inputNumber;

        while (true) {
            String input = scanner.nextLine();
            try {
                inputNumber = Integer.parseInt(input);

                if (inputNumber >= 1 && inputNumber <= 5) {
                    break;
                } else {
                    System.out.println("输入的数字不在1~5之间，请重新输入！");
                }
            } catch (NumberFormatException e) {
                System.out.println("输入的不是数字，请重新输入！");
            }
        }
    }
}
